﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Threading;
using MiniStock.Entities.Common.Events;

namespace MiniStock.BusinessLogic.EventDispatcher.MessageMap
{
    public class MessageMapEntry
    {
        public readonly ReaderWriterLock Lock = new ReaderWriterLock();

        [DataMember]
        public MessageMapStatus Status { get; set; }
        [DataMember]
        public DateTime ModificationDate { get; set; }
        [DataMember]
        public List<EventBase> Events { get; set; }

        public MessageMapEntry()
        {
            Status = MessageMapStatus.Created;
            ModificationDate = DateTime.UtcNow;
            Events = new List<EventBase>();
        }
    }
}
